[mirrors]
http://cdn.postfix.johnriley.me/mirrors/postfix-release/official/postfix-2.10.2.tar.gz
http://archive.mgm51.com/mirrors/postfix-source/official/postfix-2.10.2.tar.gz
ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-2.10.2.tar.gz

[vars]
filesize=3828326
sha512=fa6c123da040a8e332c0bf2430f5b098523c2eff42a6cf4bfe6618b82d59be8e5a7f5c85b09ab8fd0312058b2135b174e00890423e4d3f8f732c3dc3c91f01c3

[deps]
db
openssl
dovecot

[build]
CCARGS="-DNO_NIS -DUSE_TLS -DUSE_SASL_AUTH -DDEF_SASL_SERVER_TYPE=\"dovecot\"" \
AUXLIBS="-lssl -lcrypto" make -f Makefile.init makefiles
make -j$MAKE_THREADS
sh postfix-install -non-interactive \
   install_root="$butch_install_dir" \
   daemon_directory="$butch_prefix"/lib/postfix \
   manpage_directory="$butch_prefix"/share/man

dest="$butch_install_dir""$butch_prefix"
mv "$dest"/usr/* "$dest"/
rm "$dest"/bin/*
mv "$dest"/sbin/* "$dest"/bin/
rm -rf "$dest"/usr "$dest"/sbin

mv "$dest"/etc/postfix "$dest"/share/doc
install -D -m 644 "$K"/postfix-main.cf "$dest"/etc/postfix/main.cf
install -D -m 644 "$K"/postfix-master.cf "$dest"/etc/postfix/master.cf
install -D -m 644 "$K"/postfix-virtual "$dest"/etc/postfix/virtual
cat << EOF > "$dest"/etc/postfix/README
Edit 'virtual' to route mail to users, then reload with 'postmap /etc/postfix/virtual'.
See /share/doc/postfix for further information.
EOF

IS="$K"/bin/install-service
"$IS" --down --log --force postfix "$K"/services/postfix
